package com.fanrui.code.util;

import com.fanrui.code.player.Player;
import com.fanrui.proto.cmd.CurrencyType;

/**
 * 用于备份玩家数据
 * @author Administrator
 *
 */
public final class PlayerData {
	
	private final long gold;
	
	private final long money;

	public PlayerData(long gold, long money, String items) {
		super();
		this.gold = gold;
		this.money = money;
	}
	
	public PlayerData(Player player) {
		gold = player.getCurrencyValue(CurrencyType.C_Gold);
		money = player.getCurrencyValue(CurrencyType.C_Money);
	}

	public static PlayerData  createPlayerData(Player player){
		return new PlayerData(player);
	}

	public long getGold() {
		return gold;
	}

	public long getMoney() {
		return money;
	}
	
}
